/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * Warning! This file is generated. Modify at your own risk.
 */

package com.google.api.services.calendar.model;

import com.google.api.client.json.GenericJson;

/**
 * Model definition for AclRule.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Calendar API. For a detailed explanation see:
 * <a href="http://code.google.com/p/google-api-java-client/wiki/Json">http://code.google.com/p/google-api-java-client/wiki/Json</a>
 * </p>
 *
 * <p>
 * Upgrade warning: starting with version 1.12 {@code getResponseHeaders()} is removed, instead use
 * {@link com.google.api.client.http.json.JsonHttpRequest#getLastResponseHeaders()}
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class AclRule extends GenericJson {

  /**
   * The scope of the rule.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Scope scope;

  /**
   * Type of the resource ("calendar#aclRule").
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String kind;

  /**
   * ETag of the resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String etag;

  /**
   * The role assigned to the scope. Possible values are: - "none" - Provides no access.  -
   * "freeBusyReader" - Provides read access to free/busy information.  - "reader" - Provides read
   * access to the calendar. Private events will appear to users with reader access, but event
   * details will be hidden.  - "writer" - Provides read and write access to the calendar. Private
   * events will appear to users with writer access, and event details will be visible.  - "owner" -
   * Provides ownership of the calendar. This role has all of the permissions of the writer role
   * with the additional ability to see and manipulate ACLs.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String role;

  /**
   * Identifier of the ACL rule.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String id;

  /**
   * The scope of the rule.
   * The value returned may be {@code null}.
   */
  public Scope getScope() {
    return scope;
  }

  /**
   * The scope of the rule.
   * The value set may be {@code null}.
   */
  public AclRule setScope(Scope scope) {
    this.scope = scope;
    return this;
  }

  /**
   * Type of the resource ("calendar#aclRule").
   * The value returned may be {@code null}.
   */
  public String getKind() {
    return kind;
  }

  /**
   * Type of the resource ("calendar#aclRule").
   * The value set may be {@code null}.
   */
  public AclRule setKind(String kind) {
    this.kind = kind;
    return this;
  }

  /**
   * ETag of the resource.
   * The value returned may be {@code null}.
   */
  public String getEtag() {
    return etag;
  }

  /**
   * ETag of the resource.
   * The value set may be {@code null}.
   */
  public AclRule setEtag(String etag) {
    this.etag = etag;
    return this;
  }

  /**
   * The role assigned to the scope. Possible values are: - "none" - Provides no access.  -
   * "freeBusyReader" - Provides read access to free/busy information.  - "reader" - Provides read
   * access to the calendar. Private events will appear to users with reader access, but event
   * details will be hidden.  - "writer" - Provides read and write access to the calendar. Private
   * events will appear to users with writer access, and event details will be visible.  - "owner" -
   * Provides ownership of the calendar. This role has all of the permissions of the writer role
   * with the additional ability to see and manipulate ACLs.
   * The value returned may be {@code null}.
   */
  public String getRole() {
    return role;
  }

  /**
   * The role assigned to the scope. Possible values are: - "none" - Provides no access.  -
   * "freeBusyReader" - Provides read access to free/busy information.  - "reader" - Provides read
   * access to the calendar. Private events will appear to users with reader access, but event
   * details will be hidden.  - "writer" - Provides read and write access to the calendar. Private
   * events will appear to users with writer access, and event details will be visible.  - "owner" -
   * Provides ownership of the calendar. This role has all of the permissions of the writer role
   * with the additional ability to see and manipulate ACLs.
   * The value set may be {@code null}.
   */
  public AclRule setRole(String role) {
    this.role = role;
    return this;
  }

  /**
   * Identifier of the ACL rule.
   * The value returned may be {@code null}.
   */
  public String getId() {
    return id;
  }

  /**
   * Identifier of the ACL rule.
   * The value set may be {@code null}.
   */
  public AclRule setId(String id) {
    this.id = id;
    return this;
  }

  /**
   * The scope of the rule.
   */
  public static final class Scope extends GenericJson {

    /**
     * The type of the scope. Possible values are: - "default" - The public scope. This is the default
     * value.  - "user" - Limits the scope to a single user.  - "group" - Limits the scope to a group.
     * - "domain" - Limits the scope to a domain.  Note: The permissions granted to the "default", or
     * public, scope apply to any user, authenticated or not.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private String type;

    /**
     * The email address of a user or group, or the name of a domain, depending on the scope type.
     * Omitted for type "default".
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private String value;

    /**
     * The type of the scope. Possible values are: - "default" - The public scope. This is the default
     * value.  - "user" - Limits the scope to a single user.  - "group" - Limits the scope to a group.
     * - "domain" - Limits the scope to a domain.  Note: The permissions granted to the "default", or
     * public, scope apply to any user, authenticated or not.
     * The value returned may be {@code null}.
     */
    public String getType() {
      return type;
    }

    /**
     * The type of the scope. Possible values are: - "default" - The public scope. This is the default
     * value.  - "user" - Limits the scope to a single user.  - "group" - Limits the scope to a group.
     * - "domain" - Limits the scope to a domain.  Note: The permissions granted to the "default", or
     * public, scope apply to any user, authenticated or not.
     * The value set may be {@code null}.
     */
    public Scope setType(String type) {
      this.type = type;
      return this;
    }

    /**
     * The email address of a user or group, or the name of a domain, depending on the scope type.
     * Omitted for type "default".
     * The value returned may be {@code null}.
     */
    public String getValue() {
      return value;
    }

    /**
     * The email address of a user or group, or the name of a domain, depending on the scope type.
     * Omitted for type "default".
     * The value set may be {@code null}.
     */
    public Scope setValue(String value) {
      this.value = value;
      return this;
    }

  }

}
